<template>
	<view class="abnomal-agent-list-layout">
		<view class="abnomal-agent-list-title">为了保护市场规范，只显示您直营的代理商数据</view>
		<view class="agent-list">
			<view class="agent-list-item" v-for="item in dataList" :key="item.agentId" @tap="showAgentInfo(item)">
				<image src="/static/operate/agent_photo.png" mode="aspectFit"></image>
				<view class="agent-list-item-content">
					<text>{{item.agentName}}</text>
					<text>{{item.tel}}</text>
				</view>
				<view class="agent-list-item-right">
					<text>查看</text>
					<xh-icon icon="icon_jiantou"></xh-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	const props = defineProps(['data'])
	const dataList = JSON.parse(decodeURIComponent(props.data))
	const showAgentInfo = (item)=>{
		const dataStr = encodeURIComponent(JSON.stringify(item))
		uni.navigateTo({
			url:`/pages/home/agent-manager/agent-info/agent-info?data=${dataStr}`
		})
	}
</script>

<style lang="scss" scoped>
.abnomal-agent-list-layout{
	.abnomal-agent-list-title{
		padding: 30rpx;
		text-align: center;
		color: $xh-color-9;
		font-size: 26rpx;
	}
	.agent-list{
		.agent-list-item{
			display: flex;
			align-items: center;
			background-color: #fff;
			margin: 0 30rpx 20rpx;
			padding: 30rpx;
			border-radius: 20rpx;
			image{
				width: 96rpx;
				height: 96rpx;
			}
			.agent-list-item-content{
				display: flex;
				flex-direction: column;
				margin-left: 20rpx;
				text:nth-child(2){
					margin-top: 10rpx;
				}
			}
			.agent-list-item-right{
				margin-left: auto;
				font-size: 26rpx;
				color: $xh-red-color;
				display: flex;
				align-items: center;
			}
		}
	}
}
</style>
